tools/libxl: Make libxl__conversion_helper_abort() safe to use
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 4 Aug 2015 17:16:31 +0000 (18:16 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 5 Aug 2015 09:40:35 +0000 (10:40 +0100)
commit2b8ba04cd150250d23ff0a396851b7ec9a500f07
tree63211cd8950e6a955a04680a38fbb8554b1c01c2
parent8928100064f6c8a5ba0c2e798172f123024631ba
tools/libxl: Make libxl__conversion_helper_abort() safe to use

Previously, in the case of an error causing a call to
libxl__conversion_helper_abort() on a stream without legacy conversion,
libxl would fall over a NULL pointer because chs->ao was not set up.

Arrange for all ->ao's to be set up at _init() time, by having each
_init() function assert that their caller has done the right thing.
While doing so, introduce a previously-missing save_helper_init() in
stream_read_init().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
tools/libxl/libxl_convert_callout.c
tools/libxl/libxl_internal.h
tools/libxl/libxl_stream_read.c
tools/libxl/libxl_stream_write.c